package cupiPhoneInterfaz;

import java.awt.event.KeyEvent;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Event;
import java.awt.BorderLayout;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.KeyStroke;
import java.awt.Point;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JMenuItem;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JFrame;
import javax.swing.JDialog;
import java.awt.Dimension;
import javax.swing.JList;
import java.awt.Rectangle;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.BorderFactory;
import javax.swing.border.TitledBorder;
import java.awt.Font;
import java.awt.Color;
import java.util.ArrayList;

import javax.swing.JTextField;

import cupiPhoneMundo.Contacto;
import cupiPhoneMundo.ContactoRepetidoException;
import cupiPhoneMundo.CupiPhone;
import cupiPhoneMundo.Fabrica;
import cupiPhoneMundo.ICupiPhone;
import cupiPhoneMundo.IFabrica;

public class CupiPhoneInterfaz
{

    private JFrame jFrame = null; // @jve:decl-index=0:visual-constraint="10,10"
    private JPanel jContentPane = null;
    private JMenuBar jJMenuBar = null;
    private JMenu fileMenu = null;
    private JMenu opcionesMenu = null;
    private JMenu helpMenu = null;
    private JMenuItem llamadasMenuItem = null;
    private JMenuItem exitMenuItem = null;
    private JMenuItem eliminarMenuItem = null;
    private JMenuItem aboutMenuItem = null;
    private JMenuItem saveMenuItem = null;
    private JDialog aboutDialog = null; // @jve:decl-index=0:visual-constraint="442,8"
    private JPanel aboutContentPane = null;
    private JLabel aboutVersionLabel = null;
    private JLabel jLabelEngi = null;
    private JLabel jLabelabout = null;
    private JLabel jLabelLink = null;
    private JLabel jLabelMario = null;
    private JLabel jLabelBy = null;
    private JLabel jLabelYear = null;
    private PanelContactos panelContactos = null;
    private JButton jButtonTxt = null;
    private JLabel jBackGround = null;
    private JButton jButton1 = null;
    private JButton jButton2 = null;
    private JButton jButton3 = null;
    private JButton jButton4 = null;
    private JButton jButton5 = null;
    private JButton jButton6 = null;
    private JButton jButton7 = null;
    private JButton jButton8 = null;
    private JButton jButton9 = null;
    private JButton jButtonAster = null;
    private JButton jButton0 = null;
    private JButton jButtonNum = null;
    private JButton jButtonCall = null;
    private JTextField jTextFieldLlamar = null;
    private JLabel jLabelLlamar = null;
    private IFabrica mundo;
    private ICupiPhone phone;
    private CupiPhoneInterfaz cupi = this;  //  @jve:decl-index=0:

    public CupiPhoneInterfaz( )
    {
        mundo = new Fabrica( );
        phone = mundo.crearCupiPhone( );
    }

    /**
     * This method initializes panelContactos
     * 
     * @return cupiPhoneInterfaz.PanelContactos
     */
    private PanelContactos getPanelContactos( )
    {
        if( panelContactos == null )
        {
            panelContactos = new PanelContactos( this);
            panelContactos.actualizar( );
            panelContactos.setBounds( new Rectangle( 3, 3, 300, 173 ) );
        }
        return panelContactos;
    }

    /**
     * This method initializes jButtonTxt
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButtonTxt( )
    {
        if( jButtonTxt == null )
        {
            jButtonTxt = new JButton( );
            jButtonTxt.setText( "" );
            jButtonTxt.setBounds( new Rectangle( 49, 377, 95, 39 ) );
            jButtonTxt.setIcon( new ImageIcon( "./data/TecladoPhone/KeyTxt.gif" ) );
            jButtonTxt.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    FrameSmS j = new FrameSmS( cupi );
                    j.setLocationRelativeTo( null );
                    j.setVisible( true );
                }
            } );
        }
        return jButtonTxt;
    }

    /**
     * This method initializes jButton1
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButton1( )
    {
        if( jButton1 == null )
        {
            jButton1 = new JButton( );
            jButton1.setBounds( new Rectangle( 7, 209, 95, 39 ) );
            jButton1.setIcon( new ImageIcon( "./data/TecladoPhone/Key1.gif" ) );
            jButton1.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    String st = jTextFieldLlamar.getText( );
                    String aa = st + '1';
                    jTextFieldLlamar.setText( aa );
                }
            } );
        }
        return jButton1;
    }

    /**
     * This method initializes jButton2
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButton2( )
    {
        if( jButton2 == null )
        {
            jButton2 = new JButton( );
            jButton2.setBounds( new Rectangle( 108, 209, 95, 39 ) );
            jButton2.setIcon( new ImageIcon( "./data/TecladoPhone/Key2.gif" ) );
            jButton2.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    String st = jTextFieldLlamar.getText( );
                    String aa = st + '2';
                    jTextFieldLlamar.setText( aa );
                }
            } );
        }
        return jButton2;
    }

    /**
     * This method initializes jButton3
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButton3( )
    {
        if( jButton3 == null )
        {
            jButton3 = new JButton( );
            jButton3.setSize( new Dimension( 95, 39 ) );
            jButton3.setLocation( new Point( 208, 209 ) );
            jButton3.setIcon( new ImageIcon( "./data/TecladoPhone/Key3.gif" ) );
            jButton3.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    String st = jTextFieldLlamar.getText( );
                    String aa = st + '3';
                    jTextFieldLlamar.setText( aa );
                }
            } );
        }
        return jButton3;
    }

    /**
     * This method initializes jButton4
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButton4( )
    {
        if( jButton4 == null )
        {
            jButton4 = new JButton( );
            jButton4.setSize( new Dimension( 95, 39 ) );
            jButton4.setLocation( new Point( 7, 249 ) );
            jButton4.setIcon( new ImageIcon( "./data/TecladoPhone/Key4.gif" ) );
            jButton4.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    String st = jTextFieldLlamar.getText( );
                    String aa = st + '4';
                    jTextFieldLlamar.setText( aa );
                }
            } );
        }
        return jButton4;
    }

    /**
     * This method initializes jButton5
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButton5( )
    {
        if( jButton5 == null )
        {
            jButton5 = new JButton( );
            jButton5.setSize( new Dimension( 95, 39 ) );
            jButton5.setLocation( new Point( 108, 249 ) );
            jButton5.setIcon( new ImageIcon( "./data/TecladoPhone/Key5.gif" ) );
            jButton5.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    String st = jTextFieldLlamar.getText( );
                    String aa = st + '5';
                    jTextFieldLlamar.setText( aa );
                }
            } );
        }
        return jButton5;
    }

    /**
     * This method initializes jButton6
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButton6( )
    {
        if( jButton6 == null )
        {
            jButton6 = new JButton( );
            jButton6.setBounds( new Rectangle( 208, 249, 95, 39 ) );
            jButton6.setIcon( new ImageIcon( "./data/TecladoPhone/Key6.gif" ) );
            jButton6.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    String st = jTextFieldLlamar.getText( );
                    String aa = st + '6';
                    jTextFieldLlamar.setText( aa );
                }
            } );
        }
        return jButton6;
    }

    /**
     * This method initializes jButton7
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButton7( )
    {
        if( jButton7 == null )
        {
            jButton7 = new JButton( );
            jButton7.setSize( new Dimension( 95, 39 ) );
            jButton7.setLocation( new Point( 7, 289 ) );
            jButton7.setIcon( new ImageIcon( "./data/TecladoPhone/Key7.gif" ) );
            jButton7.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    String st = jTextFieldLlamar.getText( );
                    String aa = st + '7';
                    jTextFieldLlamar.setText( aa );
                }
            } );
        }
        return jButton7;
    }

    /**
     * This method initializes jButton8
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButton8( )
    {
        if( jButton8 == null )
        {
            jButton8 = new JButton( );
            jButton8.setSize( new Dimension( 95, 39 ) );
            jButton8.setLocation( new Point( 108, 289 ) );
            jButton8.setIcon( new ImageIcon( "./data/TecladoPhone/Key8.gif" ) );
            jButton8.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    String st = jTextFieldLlamar.getText( );
                    String aa = st + '8';
                    jTextFieldLlamar.setText( aa );
                }
            } );
        }
        return jButton8;
    }

    /**
     * This method initializes jButton9
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButton9( )
    {
        if( jButton9 == null )
        {
            jButton9 = new JButton( );
            jButton9.setBounds( new Rectangle( 208, 289, 95, 39 ) );
            jButton9.setIcon( new ImageIcon( "./data/TecladoPhone/Key9.gif" ) );
            jButton9.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    String st = jTextFieldLlamar.getText( );
                    String aa = st + '9';
                    jTextFieldLlamar.setText( aa );
                }
            } );
        }
        return jButton9;
    }

    /**
     * This method initializes jButtonAster
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButtonAster( )
    {
        if( jButtonAster == null )
        {
            jButtonAster = new JButton( );
            jButtonAster.setSize( new Dimension( 95, 39 ) );
            jButtonAster.setLocation( new Point( 7, 329 ) );
            jButtonAster.setIcon( new ImageIcon( "./data/TecladoPhone/Keyaster.gif" ) );
            jButtonAster.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    String st = jTextFieldLlamar.getText( );
                    String aa = st + '*';
                    jTextFieldLlamar.setText( aa );
                }
            } );
        }
        return jButtonAster;
    }

    /**
     * This method initializes jButton0
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButton0( )
    {
        if( jButton0 == null )
        {
            jButton0 = new JButton( );
            jButton0.setSize( new Dimension( 95, 39 ) );
            jButton0.setLocation( new Point( 108, 329 ) );
            jButton0.setIcon( new ImageIcon( "./data/TecladoPhone/Key0.gif" ) );
            jButton0.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    String st = jTextFieldLlamar.getText( );
                    String aa = st + '0';
                    jTextFieldLlamar.setText( aa );
                }
            } );
        }
        return jButton0;
    }

    /**
     * This method initializes jButtonNum
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButtonNum( )
    {
        if( jButtonNum == null )
        {
            jButtonNum = new JButton( );
            jButtonNum.setBounds( new Rectangle( 208, 329, 95, 39 ) );
            jButtonNum.setIcon( new ImageIcon( "./data/TecladoPhone/Key#.gif" ) );
            jButtonNum.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    String st = jTextFieldLlamar.getText( );
                    String aa = st + '#';
                    jTextFieldLlamar.setText( aa );
                }
            } );
        }
        return jButtonNum;
    }

    /**
     * This method initializes jButtonCall
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButtonCall( )
    {
        if( jButtonCall == null )
        {
            jButtonCall = new JButton( );
            jButtonCall.setBounds( new Rectangle( 157, 377, 95, 39 ) );
            jButtonCall.setIcon( new ImageIcon( "./data/TecladoPhone/KeyCall.gif" ) );
            jButtonCall.setPressedIcon( new ImageIcon( "./data/TecladoPhone/KeyEnd.gif" ) );
            jButtonCall.setText( "" );
            jButtonCall.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    JOptionPane.showMessageDialog( null, " No hay red disponible" + "\n" + " contacte a su operador", "ERROR", JOptionPane.WARNING_MESSAGE );
                    String st = jTextFieldLlamar.getText( );
                    String aa = st.replaceFirst( st, "" );
                    jTextFieldLlamar.setText( aa );
                }
            } );

        }
        return jButtonCall;
    }

    /**
     * This method initializes jTextFieldLlamar
     * 
     * @return javax.swing.JTextField
     */
    private JTextField getJTextFieldLlamar( )
    {
        if( jTextFieldLlamar == null )
        {
            jTextFieldLlamar = new JTextField( );

            jTextFieldLlamar.setBounds( new Rectangle( 68, 181, 232, 24 ) );

        }
        return jTextFieldLlamar;
    }

    /**
     * @param args
     */
    public static void main( String[] args )
    {
        // TODO Auto-generated method stub

        SwingUtilities.invokeLater( new Runnable( )
        {
            public void run( )
            {
                CupiPhoneInterfaz application = new CupiPhoneInterfaz( );
                application.getJFrame( ).setVisible( true );
            }
        } );
    }

    /**
     * This method initializes jFrame
     * 
     * @return javax.swing.JFrame
     */
    private JFrame getJFrame( )
    {
        if( jFrame == null )
        {
            jFrame = new JFrame( );
            jFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            jFrame.setEnabled( true );
            jFrame.setJMenuBar( getJJMenuBar( ) );
            jFrame.setSize( 320, 480 );
            jFrame.setContentPane( getJContentPane( ) );
            jFrame.setTitle( "CupiPhone" );
        }
        return jFrame;
    }

    /**
     * This method initializes jContentPane
     * 
     * @return javax.swing.JPanel
     */
    private JPanel getJContentPane( )
    {
        if( jContentPane == null )
        {
            jLabelLlamar = new JLabel( );
            jLabelLlamar.setBounds( new Rectangle( 8, 182, 51, 22 ) );
            jLabelLlamar.setForeground( new Color( 204, 204, 204 ) );
            jLabelLlamar.setText( "Llamar" );
            jBackGround = new JLabel( );
            jBackGround.setText( "" );
            jBackGround.setBounds( new Rectangle( 2, -53, 320, 480 ) );
            jBackGround.setIcon( new ImageIcon( "C:/tempo2/cupiPhone/data/backgrund.gif" ) );
            jContentPane = new JPanel( );
            jContentPane.setLayout( null );
            jContentPane.add( getJButtonTxt( ), null );
            jContentPane.add( getPanelContactos( ), null );
            jContentPane.add( getJButton1( ), null );
            jContentPane.add( getJButton2( ), null );
            jContentPane.add( getJButton3( ), null );
            jContentPane.add( getJButton4( ), null );
            jContentPane.add( getJButton5( ), null );
            jContentPane.add( getJButton6( ), null );
            jContentPane.add( getJButton7( ), null );
            jContentPane.add( getJButton8( ), null );
            jContentPane.add( getJButton9( ), null );
            jContentPane.add( getJButtonAster( ), null );
            jContentPane.add( getJButton0( ), null );
            jContentPane.add( getJButtonNum( ), null );
            jContentPane.add( getJButtonCall( ), null );
            jContentPane.add( getJTextFieldLlamar( ), null );
            jContentPane.add( jLabelLlamar, null );
            jContentPane.add( jBackGround, null );
        }
        return jContentPane;
    }

    /**
     * This method initializes jJMenuBar
     * 
     * @return javax.swing.JMenuBar
     */
    private JMenuBar getJJMenuBar( )
    {
        if( jJMenuBar == null )
        {
            jJMenuBar = new JMenuBar( );
            jJMenuBar.add( getFileMenu( ) );
            jJMenuBar.add( getOpcionesMenu( ) );
            jJMenuBar.add( getHelpMenu( ) );
        }
        return jJMenuBar;
    }

    /**
     * This method initializes jMenu
     * 
     * @return javax.swing.JMenu
     */
    private JMenu getFileMenu( )
    {
        if( fileMenu == null )
        {
            fileMenu = new JMenu( );
            fileMenu.setText( "File" );
            fileMenu.add( getSaveMenuItem( ) );
            fileMenu.add( getAlgoMenuItem( ) );
            fileMenu.add(getDarLlamadasMenuItem());
            fileMenu.add( getExitMenuItem( ) );
           
        }
        return fileMenu;
    }
    private JMenu getOpcionesMenu( )
    {
        if( opcionesMenu == null )
        {
            opcionesMenu = new JMenu( );
            opcionesMenu.setText( "Opciones" );
        
           
        }
        return fileMenu;
    }
    /**
     * This method initializes jMenu
     * 
     * @return javax.swing.JMenu
     */
    private JMenu getHelpMenu( )
    {
        if( helpMenu == null )
        {
            helpMenu = new JMenu( );
            helpMenu.setText( "Help" );
            helpMenu.add( getAboutMenuItem( ) );
        }
        return helpMenu;
    }

    /**
     * This method initializes jMenuItem
     * 
     * @return javax.swing.JMenuItem
     */
    private JMenuItem getExitMenuItem( )
    {
        if( exitMenuItem == null )
        {
            exitMenuItem = new JMenuItem( );
            exitMenuItem.setText( "Apagar" );
            exitMenuItem.addActionListener( new ActionListener( )
            {
                public void actionPerformed( ActionEvent e )
                {
                    System.exit( 0 );
                }
            } );
        }
        return exitMenuItem;
    }
    /**
     * This method initializes jMenuItem
     * 
     * @return javax.swing.JMenuItem
     */ 
    private JMenuItem getDarLlamadasMenuItem( )
    {
        if( llamadasMenuItem == null )
        {
            llamadasMenuItem = new JMenuItem( );
            llamadasMenuItem.setText( "Lista de llamadas" );
            llamadasMenuItem.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_Q, Event.CTRL_MASK, true ) );
            llamadasMenuItem.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    ListaLlamadas j = new ListaLlamadas ( cupi );
                    j.setLocationRelativeTo( null );
                    j.setVisible( true );
                }
            } );
        }
        return llamadasMenuItem;
    }
    /**
     * This method initializes jMenuItem
     * 
     * @return javax.swing.JMenuItem
     */
    private JMenuItem getAlgoMenuItem( )
    {
        if( eliminarMenuItem == null )
        {
            eliminarMenuItem = new JMenuItem( );
            eliminarMenuItem.setText( "Eliminar Contacto" );
            eliminarMenuItem.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_D, Event.CTRL_MASK, true ) );
            eliminarMenuItem.addActionListener( new java.awt.event.ActionListener( )
            {
                public void actionPerformed( java.awt.event.ActionEvent e )
                {
                    ElimNum j = new ElimNum( cupi );
                    j.setLocationRelativeTo( null );
                    j.setVisible( true );
                }
            } );
        }
        return eliminarMenuItem;
    }
/**
 * This method initializes jMenuItem
 * 
 * @return javax.swing.JMenuItem
 */
private JMenuItem getSaveMenuItem( )
{
    if( saveMenuItem == null )
    {
        saveMenuItem = new JMenuItem( );
        saveMenuItem.setText( "Nuevo Contacto" );
        saveMenuItem.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_C, Event.CTRL_MASK, true ) );
        saveMenuItem.addActionListener( new java.awt.event.ActionListener( )
        {
            public void actionPerformed( java.awt.event.ActionEvent e )
            {
                NewNum j = new NewNum( cupi );
                j.setLocationRelativeTo( null );
                j.setVisible( true );
            }
        } );
    }
    return saveMenuItem;
}
    /**
     * This method initializes jMenuItem
     * 
     * @return javax.swing.JMenuItem
     */
    private JMenuItem getAboutMenuItem( )
    {
        if( aboutMenuItem == null )
        {
            aboutMenuItem = new JMenuItem( );
            aboutMenuItem.setText( "About" );
            aboutMenuItem.addActionListener( new ActionListener( )
            {
                public void actionPerformed( ActionEvent e )
                {
                    JDialog aboutDialog = getAboutDialog( );
                    aboutDialog.pack( );
                    Point loc = getJFrame( ).getLocation( );
                    loc.translate( 20, 20 );
                    aboutDialog.setLocation( loc );
                    aboutDialog.setVisible( true );
                }
            } );
        }
        return aboutMenuItem;
    }

    /**
     * This method initializes aboutDialog
     * 
     * @return javax.swing.JDialog
     */
    private JDialog getAboutDialog( )
    {
        if( aboutDialog == null )
        {
            aboutDialog = new JDialog( getJFrame( ), true );
            aboutDialog.setTitle( "About" );
            aboutDialog.setSize( new Dimension( 380, 235 ) );
            aboutDialog.setContentPane( getAboutContentPane( ) );
            aboutDialog.setSize( new Dimension( 382, 233 ) );

        }
        return aboutDialog;
    }

    /**
     * This method initializes aboutContentPane
     * 
     * @return javax.swing.JPanel
     */
    private JPanel getAboutContentPane( )
    {
        if( aboutContentPane == null )
        {
            jLabelYear = new JLabel( );
            jLabelYear.setBounds( new Rectangle( 144, 173, 128, 16 ) );
            jLabelYear.setText( "2010 Colombia" );
            jLabelBy = new JLabel( );
            jLabelBy.setBounds( new Rectangle( 128, 88, 38, 16 ) );
            jLabelBy.setText( "Por:" );
            jLabelMario = new JLabel( );
            jLabelMario.setBounds( new Rectangle( 128, 104, 165, 29 ) );
            jLabelMario.setText( "Andres Felipe Tellez Garcia" );
            jLabelLink = new JLabel( );
            jLabelLink.setBounds( new Rectangle( 127, 134, 185, 25 ) );
            jLabelLink.setText( "Lino Andres Cardenas Paredes" );
            jLabelabout = new JLabel( );
            jLabelabout.setBounds( new Rectangle( 121, 16, 199, 31 ) );
            jLabelabout.setText( "CupiPhone" );
            jLabelEngi = new JLabel( );
            jLabelEngi.setBounds( new Rectangle( 12, 19, 96, 94 ) );
            jLabelEngi.setIcon( new ImageIcon( "./data/tf2_engineer.gif" ) );
            jLabelEngi.setText( "" );
            aboutContentPane = new JPanel( );
            aboutContentPane.setLayout( null );
            aboutContentPane.setBorder( BorderFactory.createTitledBorder( null, "Acerca ", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font( "Dialog", Font.BOLD, 12 ), new Color( 51, 51, 51 ) ) );
            aboutContentPane.add( getAboutVersionLabel( ), null );
            aboutContentPane.add( jLabelEngi, null );
            aboutContentPane.add( jLabelabout, null );
            aboutContentPane.add( jLabelLink, null );
            aboutContentPane.add( jLabelMario, null );
            aboutContentPane.add( jLabelBy, null );
            aboutContentPane.add( jLabelYear, null );
        }
        return aboutContentPane;
    }

    /**
     * This method initializes aboutVersionLabel
     * 
     * @return javax.swing.JLabel
     */
    private JLabel getAboutVersionLabel( )
    {
        if( aboutVersionLabel == null )
        {
            aboutVersionLabel = new JLabel( );
            aboutVersionLabel.setText("Version 1.1");
            aboutVersionLabel.setBounds( new Rectangle( 121, 51, 199, 30 ) );

        }
        return aboutVersionLabel;
    }

   
   
    
    public void darContactos(ArrayList contactos)
    {
        phone.darContactos( contactos );        
    }
    
    
    // ----------------------------------------
    // Metodos
    // ----------------------------------------
    public void agregarContacto( String nombreC, String numeroCasaC, String numeroPersonalC, String numeroTrabajoC, String numeroCelularC, String emailC ) throws ContactoRepetidoException
    {
        try
        {
            phone.agregarContacto( nombreC,  numeroCasaC,  numeroPersonalC,  numeroTrabajoC,  numeroCelularC,  emailC );
            panelContactos.actualizar( );
        }
        catch( ContactoRepetidoException e )
        {
            JOptionPane.showMessageDialog( null, "Ya existe un contacto con el nombre " + nombreC + " y telefono " + numeroCasaC, "Directorio Contactos", JOptionPane.ERROR_MESSAGE );
        }

    }

    public void palabrasDiccionario( )
    {
        int cantPal = phone.darNumeroPalabrasDiccionario( );
        JOptionPane.showMessageDialog( null, "La cantidad de palabras en el diccionario es: " + cantPal, "Cantidad", JOptionPane.INFORMATION_MESSAGE );
    }

}
